<?php 
require_once("../connect_db.php");
$sql3="select * from student,course,orders,teacher
where student.std_id=orders.std_id and orders.teach_id=teacher.teach_id
and orders.course_id=course.course_id 
and order_date_regis>='".$_GET["start"]."' and order_date_regis<='".$_GET["stop"]."' group by orders.order_id";
$query3=mysql_query($sql3);
?>
<button class="btn btn-success" onClick="Javascript:$('.split2').hide();$('.split1').show();">&#8592;ย้อนกลับ</button>
<div style="margin-top:20px;">
<h2>ข้อมูลรายรับ</h2>
</div>
<form method="post" enctype="multipart/form-data" name="frmreg" id="frmreg">

<div class="row">
	<div class="col-md-12">
		<div class="panel">
		 
		  <div class="panel-body">
		
		  
			<table cellpadding="0" cellspacing="0" border="0" class="display" id="Teacher2" width="100%" style="font-size:14px">
	<thead>
		<tr>
				<th style="width:17%;text-align: center !important;color:black; !important;font-size:1em">เลขที่ใบเสร็จ</th>
			<th style="width:15%;text-align: center !important;color:black; !important;font-size:1em">วันที่ลงทะเบียน</th>
			<th style="width:10%;text-align: center !important;color:black; !important;font-size:1em">ผู้เรียน</th>
			<th style="width:13%;text-align: center !important;color:black; !important;font-size:1em">หลักสูตร</th>
			<th style="width:10%;text-align: center !important;color:black; !important;font-size:1em">ผู้สอน</th>
			<th style="width:10%;text-align: center !important;color:black; !important;font-size:1em">จำนวนเงิน</th>
		</tr>
	</thead>
	<tbody style="color:black !important;">
	
		<?php
	$sums2=0;
		while($result3=mysql_fetch_array($query3)){
		$sums2+=$result3["price"];
		?>
		<tr>
			<td style="text-align: center !important;color:black; !important;font-size:1em"><?php echo $result3["order_id"]?></td>
			<td style="text-align: center !important;color:black; !important;font-size:1em"><?php echo $result3["order_date_regis"]?></td>
			<td style="text-align: center !important;color:black; !important;font-size:1em"><?php echo $result3["std_name"]." ".$result3["std_lname"]?></td>
			<td style="text-align: center !important;color:black; !important;font-size:1em"><?php echo $result3["course_name"]?></td>
					<td style="text-align: center !important;color:black; !important;font-size:1em"><?php echo $result3["teach_name"]." ".$result3["teach_lname"]?></td>
							<td style="text-align: center !important;color:black; !important;font-size:1em"><?php echo $result3["price"]?></td>
		</tr>
		<?php }?>
	</tbody>
	
		<tfoot>
		<tr>
				<th colspan="5" style="width:90%;text-align: left !important;color:black; !important;font-size:1em">รวมเป็นเงิน</th>
			
			<th style="width:10%;text-align: right !important;color:black; !important;font-size:1em"><?php echo $sums2;?></th>
		</tr>
	</tfoot>
	
</table>
		  </div>
		</div>
	</div>
</div>
</div>


</form>
<script>


$(document).ready(function(){
var oTable2;
  	oTable2 = $('#Teacher2').dataTable({
          "bJQueryUI": true,
          "sPaginationType": "full_numbers"
      });

 
});
	 
</script>
